﻿@{
 ViewBag.Title = "菜单列表";
 Layout = "~/Views/Shared/_IndexLayout.cshtml";
}
@section head{
}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div>
            <form class="form-inline" id="searchForm" role="form">
                <div class="form-group">
                </div>
            </form>
        </div>
        <div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">
            <button id="add" type="button" class="btn btn-outline btn-default">
                <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
            </button>
        </div>
        <table id="exampleTableEvents" data-height="100%" data-mobile-responsive="true"></table>
    </div>
</div>
@section script
{
    <!--表格参数-->
    <script>

        tableRender.addArea = ['1000px', '100%'];//新增页宽高设置
        tableRender.editArea = ['1000px', '100%'];//编辑页宽高设置
        tableRender.options['url'] =  '@(Url.Action("GetTableDataList",new{tableName="Menus"}))';
        tableRender.options['columns'] =  [
            {
                title: '操作',
                field: 'id',
                align: 'center', width: "12%",
                formatter: function (value, row, index) {
                    var e = '<a href="javascript:void(0);" title="编辑此记录" onclick="tableRender.edit(\'' + row.ID + '\')">编辑</a> ';
                    var d = '<a href="javascript:void(0);" title="删除此记录" onclick="tableRender.del(\'' + row.ID + '\')">删除</a> ';
                    return e + d;
                }
            }
            , { title: 'CreateBy', field: 'CreateBy', align: 'center'}
            , {
                        title: 'CreateDate', field: 'CreateDate', align: 'center', formatter: function (value, row, index) {
                        return ChangeDateFormat(value);
                    }
                }
            , { title: 'ModifyBy', field: 'ModifyBy', align: 'center'}
            , {
                        title: 'ModifyDate', field: 'ModifyDate', align: 'center', formatter: function (value, row, index) {
                        return ChangeDateFormat(value);
                    }
                }
            , {
                        title: 'Remove', field: 'Remove', align: 'center', formatter: function (value, row, index) {
                        return value?"是":"否";
                    }
                }
            , { title: 'RemoveBy', field: 'RemoveBy', align: 'center'}
            , {
                        title: 'RemoveDate', field: 'RemoveDate', align: 'center', formatter: function (value, row, index) {
                        return ChangeDateFormat(value);
                    }
                }
            , { title: '菜单名称', field: 'Name', align: 'center'}
            , { title: 'Code', field: 'Code', align: 'center'}
            , { title: 'Controller', field: 'Controller', align: 'center'}
            , { title: 'Action', field: 'Action', align: 'center'}
            , { title: 'Sort', field: 'Sort', align: 'center'}
            , { title: 'Render', field: 'Render', align: 'center'}
            , { title: 'Depth', field: 'Depth', align: 'center'}
            , { title: 'ChildNum', field: 'ChildNum', align: 'center'}
            
            , { title: 'State', field: 'State', align: 'center'}
            , {
                        title: 'IsChild', field: 'IsChild', align: 'center', formatter: function (value, row, index) {
                        return value?"是":"否";
                    }
                }
            , {
                        title: '是否系统菜单', field: 'IsSys', align: 'center', formatter: function (value, row, index) {
                        return value?"是":"否";
                    }
                }
            
        ];
    </script>
    <!--渲染搜索条件-->
    <script>
        renderForm([@*将表单页的设置想复制过来即可*@], '#searchForm', function (form, input, item) {
            var label = '<label>' + item.displayName + '</label>';
            input = input.replace('{replace}', 'class="form-control"');//将占位符替换为自定义内容
            var content = '&nbsp;&nbsp;<div class="form-group">' + label +'&nbsp;'+ input + '</div>';
            form.append(content);
        })
    </script>
}